/**
 * Created with JetBrains PhpStorm.
 * User: kk
 * Date: 13-8-28
 * Time: 下午4:44
 */
function U() {
    var url = arguments[0] || [];
    var param = arguments[1] || {};
    var url_arr = url.split('/');

    if (!$.isArray(url_arr) || url_arr.length < 2 || url_arr.length > 3) {
        return '';
    }

    if (url_arr.length == 2)
        url_arr.unshift(_GROUP_);

    var pre_arr = ['g', 'm', 'a'];

    var arr = [];
    for (d in pre_arr)
        arr.push(pre_arr[d] + '=' + url_arr[d]);

    for (d in param)
        arr.push(d + '=' + param[d]);

    return _APP_+'?'+arr.join('&');
}

$(function() {
	$('#newNav').click(function() {
		window.location.href = "add.html";
	});
});

function checkall() {
	var alls = document.getElementsByName("check");
	var ch = document.getElementById("checkall");
	if (ch.checked) {
		for (var i = 0; i < alls.length; i++) {
			alls[i].checked = true;
		}
	} else {
		for (var i = 0; i < alls.length; i++) {
			alls[i].checked = false;
		}
	}
}
function delAll() {
	var alls = document.getElementsByName("check");
	var ids = new Array();
	for (var i = 0; i < alls.length; i++) {
		if (alls[i].checked) {
			ids.push(alls[i].value);
		}
	}
	if (ids.length > 0) {
		if (confirm("确认操作?")) {
			alert("成功!");
		}
	} else {
		alert("请选中要操作的项");
	}
}
